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