UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aj5DwnuffMmBMHFkAOBeYQDzN0EE/0z1G9z/HmABcSQ='
WHERE
key_id = '363bfe4b4465b252293b485f1ef18d4867e12a3681e70a5f25c33778dbecc57a'
AND (
token = 'aj5DwnuffMmBMHFkAOBeYQDzN0EE/0z1G9z/HmABcSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)