UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JovEbZKxlw1/JTRXk9TKdJPOE48jA4joLbj5b1ZBimQ='
WHERE
key_id = '045499b3b62e4bdf4f2b1c05ff0f057a565e07cef4220f6bd8991efdb31fe2d1'
AND (
token = 'JovEbZKxlw1/JTRXk9TKdJPOE48jA4joLbj5b1ZBimQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)