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