UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ML2ChRuil6w32nJG7F2zubK120tFdvMf6bPjJ/vafBs=' 
WHERE 
  key_id = 'd0dd6a200e1425fa4534c61ed141f26af45ff26e0795996c16fbca6c6fd5e6c7' 
  AND (
    token = 'ML2ChRuil6w32nJG7F2zubK120tFdvMf6bPjJ/vafBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017