UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+5/ok7g0W11jpoNNVLHhSe98USKqlkuH4L1PhAlBpKc=' 
WHERE 
  key_id = '414d65ffc8e9e4f49d4b70e2f64cb3045ffd70164cdafb6d93439550bf13ae05' 
  AND (
    token = '+5/ok7g0W11jpoNNVLHhSe98USKqlkuH4L1PhAlBpKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034