UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3SqIamwDWdh/AaNl9VC2nfDe4yO5og0QF9ezdjoKDZA='
WHERE
key_id = '1e3f6d02b109038756bebe55409a201cdc5e4dc9a8ab4ddbd7a5b438a8cfb7ba'
AND (
token = '3SqIamwDWdh/AaNl9VC2nfDe4yO5og0QF9ezdjoKDZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)