UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+VWlQfJ2KR686ROWDn7mhSWTcdhqdk6mtcexomlPw8w='
WHERE
key_id = 'c17e9223cc6030dee31755df8c6d29bbbdb8f6d0af70c7db21fbab1535bb0732'
AND (
token = '+VWlQfJ2KR686ROWDn7mhSWTcdhqdk6mtcexomlPw8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)