UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vbmMQs3qtfiB+gXGwJPO+rZsR/CpAhn8enC/LQ+5W6Y='
WHERE
key_id = 'b2763c9e1bc26fb56cab257f28cf3b30f61a63347ea5fd4e15ce3e75d47dabd3'
AND (
token = 'vbmMQs3qtfiB+gXGwJPO+rZsR/CpAhn8enC/LQ+5W6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)