UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2L8TUfRXbo55ZCmc2i4bb1uiDcU5PzqUD7l4spKbH4U='
WHERE
key_id = 'c9e7ba8e880da65f31146f88da784ad056ed179ee3c73a9a17b48f18b30b7643'
AND (
token = '2L8TUfRXbo55ZCmc2i4bb1uiDcU5PzqUD7l4spKbH4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)