UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N1nnrAIyOLctS5JI2dY5OJgGBl5JmVUkWDteQuSICFM='
WHERE
key_id = '4fea7cf4a7dbe37b0ade258418adfea153cb36be877123bf127f85f782bb804f'
AND (
token = 'N1nnrAIyOLctS5JI2dY5OJgGBl5JmVUkWDteQuSICFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)