UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rZxHH4dbdIn2BFR/C9h57qLG+4kac/aojBCyqK8NDfo=' 
WHERE 
  key_id = 'fbc1cafdcbec83093d4f35fb6820f518af62dd517c29a0057a11bd29a42a870c' 
  AND (
    token = 'rZxHH4dbdIn2BFR/C9h57qLG+4kac/aojBCyqK8NDfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038