UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UfScg9B4CIOUUSFKhq4UM2y42dDC1+o5sMY47+a6o0Y=' 
WHERE 
  key_id = '26ac7ea25977c5915942b27f8dfa999297ca01f8f40f571f893c7f06594f453d' 
  AND (
    token = 'UfScg9B4CIOUUSFKhq4UM2y42dDC1+o5sMY47+a6o0Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028