UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZwJvCs4TyuuF8mib9/WhWc4ECHkmOY5OsT+FEpfFfWo='
WHERE
key_id = '5b88b061274c535472bbaf4dd6978f375ac0d054f5fb0043f0257eb4213ac04f'
AND (
token = 'ZwJvCs4TyuuF8mib9/WhWc4ECHkmOY5OsT+FEpfFfWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)