UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W5IUQGShcvcZKtRcZ8gUCdwrmU1EXh+GfQaFJIK63XE='
WHERE
key_id = '37c97f5916f19d1c060ef2b830ebe71ca166d6b9c5e9cb0c0b76bfe4b1b79414'
AND (
token = 'W5IUQGShcvcZKtRcZ8gUCdwrmU1EXh+GfQaFJIK63XE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)