UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'etPGwg+pi7JLyH26IUmflFQNSHVVy40La5NSkBWFHX0='
WHERE
key_id = 'd8d785dcc6b1c85912d184f6c3d58cc3342a6a29f8aae27191b78d4f9cca217f'
AND (
token = 'etPGwg+pi7JLyH26IUmflFQNSHVVy40La5NSkBWFHX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)