UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ePiGOPe3mjEpzZgKPmKtvF4VHqfbR+NeC41vHZaIEG4='
WHERE
key_id = '5919eeb990be0ac982e72337747826f4ffb017837f7ff716ff0b47d521bce3af'
AND (
token = 'ePiGOPe3mjEpzZgKPmKtvF4VHqfbR+NeC41vHZaIEG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)