UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kGjGFmXcjtrcLcAQuhJTZrr2oFiYSwuPSRRwaUwIAp0='
WHERE
key_id = 'efa608516071eb42bec7fd33646443100d576e61cce57eca4c15f68ef6eb55ba'
AND (
token = 'kGjGFmXcjtrcLcAQuhJTZrr2oFiYSwuPSRRwaUwIAp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)