UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2YxaNMGBG1dzStNKIM8249e5BPP5/lKyjtw04mO+5hA='
WHERE
key_id = 'f9cff73cebae589ce480e3d6f6315942e8e364333ed3a4e28cc122c6e2674339'
AND (
token = '2YxaNMGBG1dzStNKIM8249e5BPP5/lKyjtw04mO+5hA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)