UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K371sE/ixofGj9GDNRRds3efbIvzClasPKnDYvFRdzM='
WHERE
key_id = '13c331e06f2133044e7d131db58857b6a2ecdd6d54698b8735c41dfdfe7dcd30'
AND (
token = 'K371sE/ixofGj9GDNRRds3efbIvzClasPKnDYvFRdzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)