UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vPtTZ6BfGd38QtG/HZg4D0+0irNlpMGp8c41/vdX4OA=' 
WHERE 
  key_id = '89d8416de54b9c58e72c1e1cb5ead33d39677b1f1a12e3325aac425f5d3cbbeb' 
  AND (
    token = 'vPtTZ6BfGd38QtG/HZg4D0+0irNlpMGp8c41/vdX4OA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021