UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/lzvMiu+RBPP37w4AWX0+nQKzk7CMQW1uNPn4WUgDvk=' 
WHERE 
  key_id = '2885bfd78a3f64759b6e702370fd314d9877115e42ad3823d95a845b9555c114' 
  AND (
    token = '/lzvMiu+RBPP37w4AWX0+nQKzk7CMQW1uNPn4WUgDvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018