UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vj6bAVDE93Ch4YHQYrB2uJe5diPQ33k4wwcuVGpX3Lc=' 
WHERE 
  key_id = 'b2fd933976f4456398b0d2acfe0cf85f6695ca1d9999781c33e6279b1af72a97' 
  AND (
    token = 'Vj6bAVDE93Ch4YHQYrB2uJe5diPQ33k4wwcuVGpX3Lc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038