UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '25MNIxUgcpAN1+IX5p1CRusy1e1iDqdjxwvAzhksAk0=' 
WHERE 
  key_id = 'c6b20fbff35173ae49901893cc2b8c454041996f5fb7ef540abfa3d1f2aa52cd' 
  AND (
    token = '25MNIxUgcpAN1+IX5p1CRusy1e1iDqdjxwvAzhksAk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045