UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5OJEOapTfgak0KUQQLh9sx6TcurxSiWQAOGaBvVgIUk='
WHERE
key_id = '009b0fc492779ee0310a1fd87e7628a68551814edcc287801b6dba1ac6bb0da2'
AND (
token = '5OJEOapTfgak0KUQQLh9sx6TcurxSiWQAOGaBvVgIUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)