UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ejLoMppPKHxF2EKJKu0toCcN3NrEMT5PcA7Kr1JEB3w='
WHERE
key_id = '5b4ef690a9c9bf50c80ecd5ee523e2fcfa806acfbc83c1d363739a2acffbe076'
AND (
token = 'ejLoMppPKHxF2EKJKu0toCcN3NrEMT5PcA7Kr1JEB3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)