UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lNhASjXJD87MMXZZ0Mchw1+G3noB+YsopJyGcL70QrE='
WHERE
key_id = 'ad84d1c0b9ac7a058f9878c0bee607b3531d7e315aef84abbc737ccf94701960'
AND (
token = 'lNhASjXJD87MMXZZ0Mchw1+G3noB+YsopJyGcL70QrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)