UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rm6GC9SpcLgJSuoZZ/4tv2NPYpg3xQStg5BhbFF0oFw=' 
WHERE 
  key_id = '7757140fe35b1b8bb0fcfa45f47c9f5bda8d3625f589921ede7ed13dfd5ea424' 
  AND (
    token = 'Rm6GC9SpcLgJSuoZZ/4tv2NPYpg3xQStg5BhbFF0oFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053