UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dwjbTDrKXmbmAOnVKV9iCBWlO+lynvmxWgHQ77jwGD8='
WHERE
key_id = 'e5fb03fc606a466fa58cb7907c2f7957a40799adda0d099b43a62cddc6d22259'
AND (
token = 'dwjbTDrKXmbmAOnVKV9iCBWlO+lynvmxWgHQ77jwGD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)