UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e3pSflP2vvZX8w1SBKSC9hd094lKTXpfEVdUyhGOckA='
WHERE
key_id = '76a7ec49007c8216a5e7e841515dc3bcd4340d08aeb4bcf617240aecf5695c40'
AND (
token = 'e3pSflP2vvZX8w1SBKSC9hd094lKTXpfEVdUyhGOckA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)