UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'upY9DKPcTH18M65SRbjG9+wHmEdXbAi7mvpyAmDdTtE='
WHERE
key_id = '0f154aebcc04b2f7a824e49df0bce133def715157d76eec2b039737d193a0db2'
AND (
token = 'upY9DKPcTH18M65SRbjG9+wHmEdXbAi7mvpyAmDdTtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)