UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W8RuemgjRwOF61FdDVTh/Lrc7HyFIaT9tMEK9Dbjt+I='
WHERE
key_id = '4b2420593d75f4ac312f137ec9574da4369f811a0134423f359ae438a8ac5bee'
AND (
token = 'W8RuemgjRwOF61FdDVTh/Lrc7HyFIaT9tMEK9Dbjt+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)