UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JLnx6MEhH850TrBQXOHFzBRH1V/n/bfmLDbn3bN44wQ='
WHERE
key_id = '0738d3e38fedeaeb8f2204169db4d391b58a14062476d7d6e71daa955f27af91'
AND (
token = 'JLnx6MEhH850TrBQXOHFzBRH1V/n/bfmLDbn3bN44wQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)